from Crypto.Cipher import AES
from Crypto.Util import Padding
from base64 import b64encode


# 生成加密对象
obj = AES.new(''.encode(), AES.MODE_CBC, iv=''.encode())
res = obj.encrypt(Padding.pad('string'.encode(),16))

print(b64encode(res).decode())